package com.reader.api.entity.usercenter;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.reader.core.validator.group.AddGroup;
import com.reader.core.validator.group.UpdateGroup;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
*
* @@description 
* @author        jiahaikun
* @date          2018-10-31
*/
@TableName("reader_app_user")
public class User extends Model<User> {

private static final long serialVersionUID = 1L;


/**
* ID
*/

@TableId(value="id", type= IdType.AUTO)
private Integer id;


@TableField("user_name")

private String userName;


@TableField("nick_name")

private String nickName;


@NotBlank(message="手机号不能为空", groups = {AddGroup.class, UpdateGroup.class})
private String mobile;


private String password;

/**
* 头像
*/


private String avatar;

/**
* 个性签名
*/

@TableField("personal_sign")

private String personalSign;

/**
* 邮箱
*/


private String email;

/**
* 地址
*/


private String address;



private Integer enable;


@TableField("del_flag")

private Integer delFlag;

/**
* 注册来源公共代码,REGIS_FROMsmallprogram小程序,H5,APP
*/

@TableField("register_from")

private String registerFrom;

/**
* 邀请码
*/

@TableField("invite_code")

private String inviteCode;


@TableField("register_dt")

@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date registerDt;


public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public String getUserName() {
return userName;
}

public void setUserName(String userName) {
this.userName = userName;
}

public String getNickName() {
return nickName;
}

public void setNickName(String nickName) {
this.nickName = nickName;
}

public String getMobile() {
return mobile;
}

public void setMobile(String mobile) {
this.mobile = mobile;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

public String getAvatar() {
return avatar;
}

public void setAvatar(String avatar) {
this.avatar = avatar;
}

public String getPersonalSign() {
return personalSign;
}

public void setPersonalSign(String personalSign) {
this.personalSign = personalSign;
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

public String getAddress() {
return address;
}

public void setAddress(String address) {
this.address = address;
}

public Integer getEnable() {
return enable;
}

public void setEnable(Integer enable) {
this.enable = enable;
}

public Integer getDelFlag() {
return delFlag;
}

public void setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
}

public String getRegisterFrom() {
return registerFrom;
}

public void setRegisterFrom(String registerFrom) {
this.registerFrom = registerFrom;
}

public String getInviteCode() {
return inviteCode;
}

public void setInviteCode(String inviteCode) {
this.inviteCode = inviteCode;
}

public Date getRegisterDt() {
return registerDt;
}

public void setRegisterDt(Date registerDt) {
this.registerDt = registerDt;
}

@Override
protected Serializable pkVal() {
return this.id;
}

@Override
public String toString() {
return "ReaderAppUser{" +
	", id=" + id +
	", userName=" + userName +
	", nickName=" + nickName +
	", mobile=" + mobile +
	", password=" + password +
	", avatar=" + avatar +
	", personalSign=" + personalSign +
	", email=" + email +
	", address=" + address +
	", enable=" + enable +
	", delFlag=" + delFlag +
	", registerFrom=" + registerFrom +
	", inviteCode=" + inviteCode +
	", registerDt=" + registerDt +
"}";
}
}